﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional

namespace AJWPFAdmin.Services.Migrations
{
    /// <inheritdoc />
    public partial class 德阳接口相关表和字段 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "AlarmInfoRecords",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Type = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "报警类型")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    DeviceCode = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "关联设备编码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    RecordRel = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "关联通行记录ID或编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    WarningType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "预警等级类型")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Params = table.Column<string>(type: "longtext", nullable: true, comment: "报警其他参数")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Remark = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "备注信息")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PId = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    UpdateDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AlarmInfoRecords", x => x.Id);
                },
                comment: "报警信息记录")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.InsertData(
                table: "SystemConfigDictionaries",
                columns: new[] { "Key", "BooleanValue", "CreateDate", "DecimalValue", "IntValue", "StringValue", "UpdateDate" },
                values: new object[,]
                {
                    { (short)1009, false, new DateTime(2024, 11, 26, 0, 0, 0, 0, DateTimeKind.Unspecified), 0m, 0, null, null },
                    { (short)1010, false, new DateTime(2024, 11, 26, 0, 0, 0, 0, DateTimeKind.Unspecified), 0m, 0, null, null }
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AlarmInfoRecords");

            migrationBuilder.DeleteData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1009);

            migrationBuilder.DeleteData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1010);
        }
    }
}
